"use client";

import { useState } from "react";
import { RequireAuth } from "@/lib/auth/RequireAuth";
import { Header } from "@/components/layout/Header";
import { Sidebar } from "@/components/layout/Sidebar";
import { ChatArea } from "@/components/layout/ChatArea";

export default function DashboardPage() {
  const [isSidebarOpen, setIsSidebarOpen] = useState(false);

  return (
    <RequireAuth>
      <div className="h-screen flex flex-col bg-gray-50 overflow-hidden">
        {/* Page header */}
        <Header onMenuClick={() => setIsSidebarOpen(true)} />
        
        {/* Page content */}
        <div className="flex-1 flex overflow-hidden relative">
          {/* Sidebar */}
          <Sidebar 
            isOpen={isSidebarOpen}
            onClose={() => setIsSidebarOpen(false)}
          />
          
          {/* Chat area */}
          <div className="flex-1 flex flex-col min-w-0">
            <ChatArea />
          </div>
        </div>
      </div>
    </RequireAuth>
  );
}